<script setup>
import Loader from '@/components/module/Loader.vue'
import router from '@/routers/router.js'
import { onMounted } from 'vue'
import request from '@/utils/request.js'
import Cookie from '@/utils/Cookie.js'

onMounted(()=>{
  const token = Cookie.getCookie('token');
  request.instance.get("/system/isOnLine", {
    params: {
      'token': token
    }
  }).then(res => {
    if (res) {
      router.push('/messageplus/home');
    } else {
      router.push('/messageplus/login');
    }
  }).catch(err => {
    router.push('/messageplus/login');
  });
})
</script>
<template>
  <loader style="margin: calc(50vh - 1.5rem) auto 0 auto"></loader>
  <div style="width: 100%; margin-top: 50px; text-align: center; letter-spacing: 6px">系统加载中...</div>
</template>
<style scoped>
</style>